<?php
/**
 * 系统盈利设置
 */
namespace Api;

use Kuyuan\WqCore\api\Api;
use Kuyuan\WqCore\util\Util;

class SettingGain extends Api
{
    private $Setting = null;

    public function __construct()
    {
        parent::__construct();
        $this->Setting = new \Controller\SettingGain();
    }

    /**
     * 获取参数
     */
    public function find()
    {
        Util::appointGet();
        $_setting = $this->Setting->find();
        Util::returns(array("code"=>0,"data"=>$_setting));
    }

    /**
     * 设置参数
     */
    public function set()
    {
        Util::appointPost();
        if($this->Setting->set($this->_gpc["data"])){
            $_result = array("code"=>0);
        } else {
            $_result = array("code"=>103);
        }
        Util::returns($_result);
    }

}
